//package com.funny.stock.config.security;
//
//import com.funny.stock.base.util.ResultUtil;
//import com.funny.stock.base.vo.Result;
//import com.funny.stock.config.ErrorConstants;
//import com.funny.stock.user.util.UserSecurityUtil;
//
//import org.springframework.security.access.AccessDeniedException;
//import org.springframework.security.web.access.AccessDeniedHandler;
//
//import java.io.IOException;
//
//import javax.servlet.ServletException;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//
////@Component
//public class AuthenticationAccessDeniedHandler implements AccessDeniedHandler {
//
//    @Override
//    public void handle(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, AccessDeniedException e) throws IOException, ServletException {
//
//        Result result = ResultUtil.error(ErrorConstants.FORBIDDEN);
//
//        UserSecurityUtil.writeResponseResult(httpServletResponse, result);
//    }
//}
